import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { ReactiveFormsModule, FormsModule } from '@angular/forms';
import { RouterModule } from '@angular/router';
import { NgxNeditorModule } from '@notadd/ngx-neditor';
import { NgxEchartsModule } from 'ngx-echarts';

import { TranslateModule } from '@ngx-translate/core';
import { NgZorroAntdModule } from 'ng-zorro-antd';

import { PipelineFilter } from './pipes/pipeline-filter.pipe';

import { RenderDirective } from './directive/render.directive';
import { ClicekDirective } from './directive/click.directive';
import { DownloadFileDirective } from './directive/download-file.directive';

import { UploadFilesComponent } from './components/upload-files.component';
import { OssUploadFilesComponent } from './components/oss-file-upload.component';
import { UeditorComponent } from './components/ueditor.component';
import { ChartsComponent } from './components/charts.component';

import { PopupModule } from './popup/popup.module';

const THIRDMODULES = [
  NgZorroAntdModule,
  NgxEchartsModule,
  PopupModule
];

// region: your componets & directives
const PIPES = [
  PipelineFilter
];
const COMPONENTS = [
  UploadFilesComponent,
  OssUploadFilesComponent,
  UeditorComponent,
  ChartsComponent
];
const DIRECTIVES = [
  RenderDirective,
  ClicekDirective,
  DownloadFileDirective
];

@NgModule({
  imports: [
    CommonModule,
    FormsModule,
    RouterModule,
    ReactiveFormsModule,
    TranslateModule,
    // third libs
    ...THIRDMODULES,
    NgxNeditorModule
  ],
  declarations: [
    // your components
    ...PIPES,
    ...COMPONENTS,
    ...DIRECTIVES
  ],
  exports: [
    CommonModule,
    FormsModule,
    ReactiveFormsModule,
    RouterModule,
    // i18n
    TranslateModule,
    // third libs
    ...THIRDMODULES,
    // your components
    ...PIPES,
    ...COMPONENTS,
    ...DIRECTIVES
  ],
})
export class SharedModule { }
